import logging,yagmail
import time
#定义日志
def log_set():
    t = time.strftime('%Y%m%d_%H%M%S')
    logging.basicConfig(filename=f'log_{t}.txt',
                        filemode='a+',
                        level=logging.DEBUG,
                        format='%(asctime)s -> %(filename)s -> %(message)s -> %(funcName)s')

#定义邮件
def send_mail(filepath):
    mail = yagmail.SMTP(user='2930885223@qq.com',password='zlmqxmanqbtsdcgh',host='smtp.qq.com')
    mail.send(to='2930885223@qq.com',subject='酒仙网系统Web Ui自动化测试报告',contents='今日测试报告——酒仙网报告已完成，请查收',attachments=filepath)
